package cn.j2ee.chapter2.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import org.springframework.web.servlet.mvc.Controller;
import org.springframework.web.servlet.mvc.LastModified;
import org.springframework.web.servlet.mvc.ServletWrappingController;

/**
 * 
 * 2016年10月25日 下午6:48:01
 */
public class HelloWorldController extends AbstractController implements LastModified {
	private long lastModified;
	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		response.getWriter().write("<a href=''>this</a>");
		return null;
	}

	@Override
	public long getLastModified(HttpServletRequest request) {
		if(lastModified == 0L){
			lastModified = System.currentTimeMillis();
		}
		return lastModified;
	}  
}  
